const Controller = require('egg').Controller;
class MyProductController extends Controller {
  async getProduct() {
    const {ctx} = this
    const productList = await ctx.service.myProduct.getProductList()
    if(productList) {
      ctx.body = {
        code: 20000,
        data: productList
      }
    }
    else{
      ctx.body = {
        code: 50000,
        data: '服务器异常'
      }
    }
  }
}
module.exports = MyProductController